import { type ComponentCustomProperties, getCurrentInstance } from 'vue'

export function useGlobalProperties(): ComponentCustomProperties | null {
    const instance = getCurrentInstance()
    if (!instance) {
        console.warn('useGlobalProperties() 只能在setup() 或功能组件中使用。')
        return null
    }
    return instance.appContext.config.globalProperties
}
